package com.wjh.yygh.oss.controller;

import com.wjh.yygh.common.result.Result;
import com.wjh.yygh.oss.service.FileService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@Api(tags = "阿里云文件上传")
@RequestMapping("/api/oss/file")
@RestController
public class FileApiController {

    @Autowired
    @Qualifier("fileServiceCosImpl")
    private FileService fileService;

    /**
     *
     */
    @ApiOperation(value = "上传文件")
    @PostMapping("/fileUpload")
    public Result upload(MultipartFile multipartFile){
        return Result.ok(fileService.upload(multipartFile));
    }

}
